package com.doit.day04

import java.time.format.DateTimeFormatter
import java.time.{Instant, LocalDateTime, ZoneId, ZoneOffset, ZonedDateTime}

object Test001 {
  def main(args: Array[String]): Unit = {
    val timestamp = 978302268 // 输入要转换的秒级别时间戳
    val offset: ZoneOffset = ZoneOffset.ofTotalSeconds(3600 * 8)
    val dateTime = LocalDateTime.ofEpochSecond(timestamp, 0, offset)
    val formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd hh:mm:ss")
    val formattedDate = dateTime.format(formatter)
    println(formattedDate)
  }

}
